package ajax;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet(name = "ShowPhotoAjax", urlPatterns = "/showPhotoAjax")
public class ShowPhotoAjax extends HttpServlet {

    int time=1;

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


        String url=request.getParameter("uFace");

        if(url==null)
            url="default_photo.gif";

        url="../FinalWork/img/head/"+url;

        String html="<img src='"+url+"' style='width:100%;height:100%'>";
        response.getWriter().write(html);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

}
